﻿@page "/counter"
@using Reactive.Bindings
@implements IDisposable
@inject CounterViewModel CounterViewModel

<PageTitle>Counter</PageTitle>

<h1>Counter</h1>

<p role="status">Current count: @CounterViewModel.Counter.Value</p>

<button class="btn btn-primary"
        @onclick="() => CounterViewModel.IncrementCommand.Execute()"
        disabled="@CounterViewModel.IncrementCommand.IsDisabled()"
        type="button">
    Click me
</button>

@code {
    public void Dispose() => CounterViewModel.Dispose();
}